﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Eleanor.BLL;
using System.Data;
using Eleanor.Website.Utility;

namespace Eleanor.Website.Areas.Admin.Controllers
{
    public class AccountController : Controller
    {
        protected SubscriberBLL subscriberBLL = new SubscriberBLL();

        public ActionResult ExportSubscriber()
        {
            DataTable dataTable = subscriberBLL.GetDataTable();
            var exporter = new NpoiExport();
            exporter.ExportDataTableToWorkbook(dataTable, "Subscriber");
            ActionResult actionResult = File(exporter.GetBytes(), "application/vnd.ms-excel", "subscriber.xls");
            exporter.Dispose();
            return actionResult;
        }
    }
}
